﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ForrajeriaBCL;
using ForrajeriaDB;


namespace ForrajeriaFRONT.Reportes
{
    public partial class EmpleadoMasVentas : System.Web.UI.Page
    {
        EmpleadoBCL empleadoBC = new EmpleadoBCL();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            

            if (!Page.IsPostBack)
            {
                gridProveedor.DataSource = null;
                gridProveedor.DataBind();
                calendar.SelectedDate = DateTime.Today;
            }
        }

         
        protected void btnFiltrar_Click(object sender, EventArgs e)
        {
            if(calendar.SelectedDate == null)
            { calendar.SelectedDate = DateTime.Today; }
            try
            {   string ordena = "";
                string dire = "";
                gridProveedor.DataSource = empleadoBC.reporteEmpleadoMasVentas(calendar.SelectedDate, ordena, dire);
                gridProveedor.DataBind();
                if (gridProveedor.Rows.Count == 0)
                {
                    lblVacio.Visible = true;
                }
                else
                {
                    lblVacio.Visible = false;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("/Default.aspx");
            }

        }

        protected void gridProveedor_PageIndexChanged(object sender, EventArgs e)
        {

        }

        protected void gridProveedor_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

        protected void gridProveedor_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void gridProveedor_Sorting(object sender, GridViewSortEventArgs e)
        {

        }

    }
}